<template>
  <div class="reset-button-container">
    <button class="reset-button" @click="resetEnvelope" title="重新体验开屏动画">
      <span class="reset-icon">💌</span>
      <span class="reset-text">重新开始</span>
    </button>
  </div>
</template>

<script>
export default {
  name: 'ResetButton',
  emits: ['reset-envelope'],
  setup(props, { emit }) {
    const resetEnvelope = () => {
      // 清除本地存储
      localStorage.removeItem('hasVisited')
      // 触发重置事件
      emit('reset-envelope')
    }
    
    return {
      resetEnvelope
    }
  }
}
</script>

<style scoped>
.reset-button-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.reset-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reset-button:hover {
  background: rgba(255, 107, 157, 0.1);
  border-color: rgba(255, 107, 157, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.2);
}

.reset-icon {
  font-size: 16px;
  animation: bounce 2s ease-in-out infinite;
}

.reset-text {
  font-size: 0.9rem;
  color: #495057;
  font-weight: 500;
  font-family: 'LoveFont', cursive;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .reset-button-container {
    top: 10px;
    right: 10px;
  }
  
  .reset-button {
    padding: 8px 12px;
  }
  
  .reset-text {
    font-size: 0.8rem;
  }
}
</style>
